﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LoadNorthwindDB;

namespace Ex7.ConcuracyControl
{
    public class CCTest
    {
        public static void Main()
        {
            NorthwindEntities ent1 = new NorthwindEntities();
            //NorthwindEntities ent2 = new NorthwindEntities();
            //using (ent1)
            //{
            //    Customer customer = ent1.Customers.FirstOrDefault(c => c.CustomerID == "99999");
            //    Console.WriteLine("\nBefore change:");
            //    Console.WriteLine(customer.ContactName);
            //    Console.WriteLine(customer.City);

            //    customer.ContactName = "Blabla";
            //    using (ent2)
            //    {
            //        customer.City = "Plovdiv";
            //    }
            //    ent1.SaveChanges();
            //    Customer newCustomer = ent1.Customers.FirstOrDefault(c => c.CustomerID == "99999");
            //    Console.WriteLine("\nAfter change:");
            //    Console.WriteLine(newCustomer.ContactName);
            //    Console.WriteLine(newCustomer.City);
            //}
        }
    }
}
